package com.liudadan.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("error")
public class ErrorController {

    @GetMapping("data1")
    public String data1(){
        System.out.println("ErrorController.data1");
        String name  = null;
        name.toString();
        return  "null point exception";
    }

    @GetMapping("data2")
    public String data2(){
        System.out.println("ErrorController.data2");
        int i = 1/0;
        return  "by zero exception !!";
    }

    @GetMapping("data3")
    public String data3(){
        System.out.println("ErrorController.data3");
        return "success";
    }
}
